@model LanLordz.Models.EditPostModel
@{
    ViewBag.Title = "Edit Post";
}
@section headers
{
  <script type="text/javascript">
   //<![CDATA[
   function AddTags(tagName, parameter, innerData) {
    var textarea = document.getElementById("Text");
    textarea.focus();
    textarea.value = textarea.value + "[" + tagName + (parameter ? "=" + parameter : "") + "]" + (innerData ? innerData : "") + "[/" + tagName + "]";
   }
   function AddEmoticon(emoticon) {
   }
   //]]>
  </script>
}
    <h2>@ViewBag.Title</h2>
    @using (Html.BeginForm())
    {
     @Html.AntiForgeryToken()
     <table class="CreatePostTable">
      <tr><td>Subject:</td><td>@Html.TextBox("Title", Model.Post.Title, new { @class = "EditPostTitleBox" }) (60 Character Limit)</td></tr>
      <tr>
       <td></td>
       <td>
        <input type="button" onclick="AddTags('b');" value="B" style="font-weight : bold;" />
        <input type="button" onclick="AddTags('i');" value="I" style="font-style : italic;" />
        <input type="button" onclick="AddTags('u');" value="U" style="text-decoration : underline;" />
        <input type="button" onclick="AddTags('s');" value="S" style="text-decoration : line-through;" />
        <input type="button" onclick="AddTags('code');" value="Code" style="" />
        <input type="button" onclick="AddTags('quote', 'Author');" value="&quot;Quote&quot;" style="" />
        <input type="button" onclick="AddTags('link', 'http://', 'Link Caption');" value="Link" style="" />
        <input type="button" onclick="AddTags('img', 'Alt Text', 'http://');" value="Image" style="" />
        <input type="button" onclick="AddTags('spoiler');" value="Spoiler" style="" />
        <input type="button" onclick="AddTags('youtube', 'videoid', 'Caption');" value="YouTube" style="" />
       </td>
      </tr>
      <tr>
       <td>Body:</td>
       <td>
        @Html.TextArea("Text", Model.Post.Text, 2, 20, new { @class = "EditPostBodyBox" })
       </td>
      </tr>
      @if (Model.UserAccess.CanModerate)
      {
      <tr>
       <td>Thread Level:</td>
       <td>
        @Html.DropDownList("Level", from level in Model.AvailableThreadLevels
                                    select new SelectListItem
                                    {
                                        Text = level.Name,
                                        Value = level.Level.ToString(),
                                        Selected = Model.Thread.Level == level.Level
                                    }, new { @class = "EditThreadLevelBox" })
       </td>
      </tr>
      <tr>
       <td>Lock Thread:</td>
       <td>@Html.CheckBox("Locked", Model.Thread.IsLocked, new { @class = "EditThreadLockedBox" })</td>
      </tr>
      }
      <tr>
       <td></td>
       <td><input type="submit" value="Post" class="EditPostSubmitButton" /></td>
      </tr>
     </table>
    }
